# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

{
    'name': 'Accounting Balance',
    'version': '1.0',
    'category': 'Accounting',
    'summary': 'Accounting Balance, Accounting Report Sheet',
    'description': """
Accounting Balance
===========================================================================

This module is for account report shhet: balance, profit sheet.
     1st: create db with my company
     2nd: install account module.
          china standard chart_template  if select country
          no chart_template  if select no country
     3rd: install this module -- Accounting Balance
     4th: choice china small business chart_template
          so create date in model -- account.account
          so set tag_ids in model -- account.account

account.account:
1. add 2 fields: general code and name
2. set tag_ids

account.account.tag:
1. balance sheet item store in here
2. balance sheet item is group of account.account
3. detail account type is set in here

account.sub.account:
1. A sub_account_id composed of
   account_id + ( partner_id | product_id | analytic_account_id | journal_id)
2. account_id = 1002 bank, detail type = bank, journal_id
2. account_id = 1122 应收,  detail type = partner, partner
2. account_id = 1405 库存商品, detail type = product, product_id
2. account_id = ?, detail type = analytic, analytic_account_id


account.move.line:
1. sub account with partner/product is 1st
2. sub account with journal is only used for 1002 bank
3. sub account with analytic should be careful
4. analytic_tag_ids is m2m field to reference model 'account.analytic.tag'
4. so, analytic_tag_ids to be set for some ...
5. sub account is set auto.
6. sub account is only used for report
7. date_maturity is used for 'little than one year'
8. a new function to get 'little than one year'


account.move:
1. a new field: attachment_count

account.balance.line:
1. account_id + sub_account_id
2. sub_account_id is computed by partner, product, analytic, journal
3. balance_open is set by last month balance_close
4. debit_open and credit_open is computed by balance_open
5. debit and credit is computed by account move of current month
6. balance is computed by debit and credit
7. balance_close, debit_close, credit_close is computed by open + current


account.balance:
1. to set balance open: insert a record of last month
2. date field is the first day of calendar month
3. generate_balance: insert a record of this month for sum all account move line of this month
4. get_balance_sheet: account.tag,account.account,account.balance
5. get_detail_ledger: account.move + account.balance
6. get_general_ledger: account.move + account.balance, account.account.general_account
7. get_profit_sheet: account.move.line of profit journal
8. get_balance: account.balance
9. get_move_sum: account.move move_count, attachment_count
9. get_move_sum_lines: general.account debit, credit delta


account_tag for detail account

partner,"1121,1122,1123,1131,1132,1221,1231,1231.1122,1231.1123,1231.1221,1501,1502,1503,1511,1512,1521,1531,2001,2201,2202,2203,2231,2232,2241,2501,2502,2701,2711,2801"
product,"1401,1402,1403,1404,1405,1406,1407,1408,1471,1471.1403,1471.1405,1471.1408,1601,1602,1603,1604,1605,1606,1701,1702,1703,1711,1801,2211"
bank,"1002,1012"
analytic,""


    """,
    'author': 'odoowww@163.com',
    #'website': 'https://www.odoowww.com',
    'depends': ['base','account' ],
    'data': [
        'data/account.account.tag.csv',
        'security/ir.model.access.csv',
        'data/account.xml',
    ],
    'demo': [
        #
        #
    ],
    'installable': True,
    'auto_install': False,
}
